package string;

public class TrimDemo {
    public static void main(StringBuilderDemo[] args) {
        String str = "    hello word    ";
        str.trim();//创了一个新的对象"hello word",但还没存储
        System.out.println(str);//所以还是"    hello word    "
        str = str.trim();//创了一个新的对象"hello word",并存储
        System.out.println(str);
        System.out.println(str.trim());
    }
}
